package com.yang.dao.entity;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Student implements Serializable{
    private Integer id;

    private String name;

    private Integer age;

    private String addr;

    private String note;

    private Date date;

    public Student() {

    }

    public Student(Integer id, String name, Integer age, String addr, String note, Date date) {
        this.id = id;
        this.name = name;
        this.age = age;
        this.addr = addr;
        this.note = note;
        this.date = date;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name == null ? null : name.trim();
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public String getAddr() {
        return addr;
    }

    public void setAddr(String addr) {
        this.addr = addr == null ? null : addr.trim();
    }

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note == null ? null : note.trim();
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public String getBirthDatestr() {
        SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd");
        return formater.format(getDate());
    }

    @Override
    public  String toString(){
        return  "id: "+id+"  name: "+name+"  age: "+age+"  addr: "+addr+"  note: "+note+"  BirthDatestr:"+getBirthDatestr();

    }
}